package com.hcbd.tdwt.base.bd;
import com.hcbd.tdwt.base.BeidouBoxParams;
import com.pangu.bdsdk2021.terminal.TerminalSendManager;

import static java.lang.Thread.sleep;


public class XyBdSendChild extends BdSendBase{
 @Override
 public void sendMsg(String number, int frePoint, int mode, String content) {
  if(BeidouBoxParams.card_model==2){
   frePoint=1;
  }
  TerminalSendManager.getInstance().levelThreeGetCCTCQ(number,frePoint,mode,content);
 }


 @Override
 public  void getICInfo() {
  TerminalSendManager.getInstance().levelThreeGetCCICR();
 }

 @Override
 public void sendEPQInfo(String TheReceivingPartyID,int EmergencySigns, int ElevationValue, int SearchAndRescueType) {
  TerminalSendManager.getInstance().levelThreeCCEPQ(TheReceivingPartyID,2,EmergencySigns,ElevationValue,SearchAndRescueType);
 }

 @Override
 public void initBle() {
  super.initBle();
  new Thread(() -> {
   try {
    sleep(500);
    //登录
    TerminalSendManager.getInstance().level_two_login("000000");
    sleep(1000);
    //读卡
    getICInfo();
    sleep(1000);
    //终端信息
    TerminalSendManager.getInstance().level_two_getZDCInfo(0);
    sleep(1000);
    TerminalSendManager.getInstance().levelThreeGetCCRMO();
    sleep(1000);
    //读卡
    getICInfo();

   } catch (InterruptedException e) {
    e.printStackTrace();
   }
  }).start();
 }

}
